import { createBrowserRouter, Navigate } from "react-router-dom";
import App from '../App'
// 登陆模块路由
import Login from "../view/Login/Login";
import Register from "../view/Login/Register";
import Forget from "../view/Login/forget";
import Face from "../view/Login/Face";

// 首页模块路由
import Index from "../view/Index/Index";
import Indexa from '../view/Index/Indexa'
import Indexse from '../view/Index/Indexse'
// 分类模块路由
import Cate from "../view/Cate/Cate";
//详细页面
import Edit from '../view/Cate/Edit'
//确认订单（详细页面结算）
import Confrim from '../view/Cate/Confrim'
//确认订单（购物车结算）
import CartConfrim from '../view/Cart/CartConfrim'


// 消息模块路由
import Mess from "../view/Message/Mess";
import Chat from "../view/Message/component/Chat";

// 订单模块路由
import Cart from "../view/Cart/Cart";

// 我的模块路由
import Mine from "../view/Mine/Mine";
import Personal from '../view/Mine/views/Personal'
import Wallet from '../view/Mine/views/Wallet'
import Collect from '../view/Mine/views/Collect'
import Orderform from '../view/Mine/views/Orderform'
import Discount from '../view/Mine/views/Discount'
import Harvest from "../view/Mine/Views/Harvest";
import Account from '../view/Mine/views/Account'
import System from '../view/Mine/views/System'
import Message from '../view/Mine/views/Message'
import TopUp from "../view/Mine/Views/TopUp";
import OrderSuccess from "../view/Mine/Views/orderSuccess";
import Addharvest from "../view/Mine/Views/Addharvest";
import PwdSuccess from "../view/Mine/Views/PwdSuccess";
import Paypwd from '../view/Mine/Views/PayPwd'
import Details from "../view/Mine/Views/Details";
import OrderPay from "../view/Mine/Views/OrderPay";
import ChangePayPwd from "../view/Mine/Views/ChangePayPwd";
const router = createBrowserRouter([
    {
        path: '/',
        element: <Navigate to='/show/index' />
    },
    {
        path: '/show',
        element: <App />,
        children: [
            { path: 'index', element: <Index /> },
            { path: 'cate', element: <Cate /> },
            { path: 'mess', element: <Mess /> },
            { path: 'cart', element: <Cart /> },
            {
                path: 'mine',
                element: <Mine />,
            },
        ]
    },
    //详细页面
    {
        path:'/edit',
        element:<Edit/>,
    },
    //确认订单(详细页面结算)
    {
        path:'/confrim',
        element:<Confrim/>,
    },
    //确认订单(购物车结算)
    {
        path:"/CartConfrim",
        element:<CartConfrim/>,
    },
   
    // 登陆模块路由
    {
        path: '/Login',
        element: <Login />
    },
    {
        path: '/Register',
        element: <Register />
    },
    {
        path: '/Forget',
        element: <Forget />
    },
    {
        path: '/Face',
        element: <Face />
    },

    // 首页模块路由
    {
        path:'/indexa',
        element:<Indexa/>

    },
    //城市
    {
        path:'/index',
        element:<Index/>

    },
    //搜索
    {
        path:'/indexse',
        element:<Indexse/>

    },


    // 分类模块路由


    // 消息模块路由
    {
        path: '/chat',
        element: <Chat />
    },

    // 订单模块路由

    // 我的模块路由
    {
        path: '/personal', // 个人信息
        element: <Personal />
    },
    {
        path: '/message', // 消息
        element: <Message />
    },
    {
        path: '/wallet/:id', // 钱包
        element: <Wallet></Wallet>
    },
    {
        path: '/collect', // 收藏
        element: <Collect></Collect>

    },
    {
        path: '/orderform', // 订单
        element: <Orderform></Orderform>
    },
    {
        path: '/discount', // 优惠卷
        element: <Discount></Discount>
    },
    {
        path: '/harvest', // 收获地址
        element: <Harvest></Harvest>
    },
    {
        path: '/addharvest',
        element: <Addharvest></Addharvest>
    },
    {
        path: '/account', // 账户与安全
        element: <Account></Account>
    },
    {
        path: '/system', // 系统设置
        element: <System></System>
    },
    {
        path: '/topup', // 充值页面
        element: <TopUp></TopUp>
    },
    {
        path: '/ordersuccess/:id', // 充值成功
        element: <OrderSuccess></OrderSuccess>
    },
    {
        path: '/setpwd',
        element: <PwdSuccess></PwdSuccess>
    },
    {
        path: '/paypwd',
        element: <Paypwd></Paypwd>
    },
    {
        path: '/details',
        element: <Details></Details>
    },
    {
        path: '/orderpay',
        element: <OrderPay></OrderPay>
    },
    {
        path: '/changepaypwd',
        element: <ChangePayPwd></ChangePayPwd>
    },

])
export default router